<form class = "layui-form ajax _form" action="{:url('add')}" method="post" id = "add_goods">
    <div class = "layui-form-item">
        <label class = "layui-form-label require">商品名称</label>
        <div class = "layui-input-block">
            <input type="text" name="name" placeholder="请输入商品名称" class="layui-input"required lay-verify="required" />
        </div>
    </div>
    <div class = "layui-form-item">
        <label class = "layui-form-label require">关键字</label>
        <div class = "layui-input-block">
            <div class = "keyword layui-input" name="keyword"></div>
        </div>
    </div>
    <div class = "layui-row">
        <div class = "layui-col-xs6">
            <div class = "layui-form-item">
                <label class = "layui-form-label require">成本价</label>
                <div class = "layui-input-block">
                    <input type="money" placeholder="请输入成本价" class="layui-input" name="origcost" required lay-verify="required"/>
                </div>
            </div>
        </div>
        <div class = "layui-col-xs6">
            <div class = "layui-form-item">
                <label class = "layui-form-label require">售价</label>
                <div class = "layui-input-block">
                    <input type="money" placeholder="请输入售价" class="layui-input" name="price" required lay-verify="required"/>
                </div>
            </div>
        </div>
    </div>

    <div class = "layui-form-item">
        <label class = "layui-form-label require">快递规则</label>
        <div class = "layui-input-block">
            <select name="express_id" required lay-verify="required">
                <option value="">请选择快递规则</option>
                {:archive_option('Express','name','id','',$mer_id)}
            </select>
        </div>
    </div>
    <div class = "layui-form-item">
        <label class = "layui-form-label">库存</label>
        <div class = "layui-input-block">
            <input type="number" placeholder="请输入库存" class="layui-input" name="stock"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">立即上架</label>
        <div class="layui-input-block">
            <input type="checkbox" name="state" value="1" lay-skin="switch">
        </div>
    </div>
    <div class = "layui-form-item">
        <label class = "layui-form-label">描述</label>
        <div class = "layui-input-block">
            <textarea class = "layui-textarea"></textarea>
        </div>
    </div>
    <div class = "layui-form-item">
        <div name="images" id = "images"></div>
    </div>
    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">基本属性</h2>
            <div class="layui-colla-content">
                <div class = "layui-form-item">
                    <label class = "layui-form-label">品牌</label>
                    <div class = "layui-input-block">
                        <select name = "company">
                            <option value = ''>请选择品牌</option>
                            {:archive_option('Company','name','id','',$mer_id)}
                        </select>
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class = "layui-form-label">季节</label>
                    <div class = "layui-input-block">
                        <select name = "season">
                            <option value = ''>请选择季节</option>
                            {:archive_option('Season','name','id','',$mer_id)}
                        </select>
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class = "layui-form-label">货号</label>
                    <div class = "layui-input-block">
                        <input type="text" name="code" class = "layui-input"/>
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class = "layui-form-label">材质</label>
                    <div class = "layui-input-block">
                        <input type="text" name="material" class = "layui-input"/>
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class="layui-form-label">款式</label>
                    <div class = "layui-input-block">
                        <input type="text" name="style" class = "layui-input"/>
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class = "layui-form-label">适用场景</label>
                    <div class = "layui-input-block">
                        {:archive_checkbox("Scene", "name", "id", "",$mer_id,"scene")}
                    </div>
                </div>
                <div class = "layui-form-item">
                    <label class = "layui-form-label">适用对象</label>
                    {:archive_checkbox("Intent", "name", "id", "",$mer_id,"intended")}
                </div>
            </div>
        </div>
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">尺码规格</h2>
            <div class="layui-colla-content">
                <table class = "layui-table">
                    <thead>
                        <tr>
                            <th>规格</th>
                            <th>价格</th>
                            <th><i class = "layui-icon layui-icon-add-1" onclick="newTr()"></i></th>
                        </tr>
                    </thead>
                    <tbody id = "specs">
                        <tr>
                            <td><input type="text" class = "table-input" name = "spec_name[]"/></td>
                            <td><input type="money" class = "table-input" name = "spec_price[]"/></td>
                            <td><i class = "layui-icon layui-icon-close" onclick = "del(this)"></i></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">颜色</h2>
            <div class="layui-colla-content">
                <table class = "layui-table">
                    <thead>
                    <tr>
                        <th>颜色</th>
                        <th>图片</th>
                        <th>价格</th>
                        <th><i class = "layui-icon layui-icon-add-1" onclick="newColor()"></i></th>
                    </tr>
                    </thead>
                    <tbody id = "colors">

                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class = "options clearfix">
        <button class = "layui-btn layui-btn-success vm-4 fr" type="submit">提交</button>
    </div>
</form>
